<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../css/aui.css" /> 
	<link rel="stylesheet" type="text/css" href="../css/1play.css"/>
</head>
<body>
    <header class="aui-bar aui-bar-nav" id="aui-header" style="background: linear-gradient(to right,#1e90ff 0,#1e90ff 100%);">
        <a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
            <span class="aui-iconfont aui-icon-left" style="color:#FFF"></span>
        </a>
        <div id="title" class="aui-title"> <!-- 聚眾影視--> </div>

		
		        <a class="aui-btn aui-pull-right" onclick="sharetext()"> 
            <span class="aui-iconfont aui-icon-share" style="color:#FFF"></span>
        </a>
		<!--a id=dlna tapmode onclick="browse()" class="" style="color: #FFFF00;">
        <img src="../image/touping.png" class="dlna" />
        <b style="float:right;line-height:55px;font-size:0.5rem;">
		<marquee><strong><span style="color:#EE33EE;font-size:10px;"></span></strong></marquee>
		</b>
    </a-->

    </header> 

</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/common.js"></script>
<script type="text/javascript" src="../script/date.min.js"></script>
<script type="text/javascript">
 	var leCastDemo = null;
    var uid1 = "";
    var uzmoduledemo = null;
    var TVURL = "";

  var api_url = localStorage.getItem('api_url');
  var dwzapi = '';
  var host = '';



  apiready = function(){
    		  if(api.systemType == 'android'){
            leCastDemo = api.require('leCast');
            leCastDemo.initLeCast(); //模块初始化方法，必须在所有方法调用前调用
            uzmoduledemo = api.require('androidBrowser');
            var param = {
                /*
                x:浏览器窗口X位置，默认0
                y:浏览器窗口y位置，默认0
                w:浏览器宽度，默认满屏
                h:浏览器高度，默认满屏
                */
                rect: {
                    x: 0,
                    y: $api.dom('header').offsetHeight + 50,
                    w: 'auto',
                    h: 'auto',
                }, //w,h等于0代表横向满屏和纵向满屏
                fixedOn: "", //浏览器依附在哪个window,不传或传空 为 当前Window，默认当前当前Window
                fixed: true, //浏览器是否随frame或Window滑动，默认当前当前true
                url: api.pageParam.url, //要加载的url,可选项
                browserBg: "#F0F0F0", //可选
                timeout: 7, //超时时间,指加载页面完毕后等待多少秒，超过这个时间还没收到视频地址，则认为解析视频地址失败。默认7秒

            };
            uzmoduledemo.openView(param, function(ret, err) {
                //alert(JSON.stringify(ret));
                if (ret.result == '1') {
                    TVURL = ret.VideoUrl;
                    var dlna = $api.byId('dlna');
                    dlna.style = "display:block";
                    uzmoduledemo.closeView( function(ret, err){
          	        	//alert(JSON.stringify(ret));
          	        });
                }
            });
        }

    api.parseTapmode();
	
	
	
	      api.addEventListener({
          name: 'keyback'
      }, function(ret, err) {
        api.setScreenOrientation({
            orientation: 'portrait_up'
        });
        api.closeWin();
		
		var browser = api.require('webBrowser');
		browser.closeView();
		
		
      });
	
	
	
	
	
	
    var header = $api.byId('aui-header');
    $api.fixStatusBar(header);
    var headerPos = $api.offset(header);
    var body_h = $api.offset($api.dom('body')).h;
	
	

	if(api.pageParam.title == undefined){
	
  title.innerHTML = '<img src="" style="width: 20px;display: inline;margin-right: 10px;"> VIP播放中···';
	
	}else{
	
  title.innerHTML = '<img src="" style="width: 20px;display: inline;margin-right: 10px;"> ' +api.pageParam.title;
  
  
	}
	
    api.openFrame({
        name: 'video_jiexi_play_frm',
        url: 'video_jiexi_play_frm.html',
        bounces: false,
        rect: {
            x: 0,
            y: headerPos.h,
            w: 'auto',
            h: 'auto'
        },           
		bounces : true,
            bgColor : 'rgba(255,255,255,0)',
            vScrollBarEnabled : true,
            hScrollBarEnabled : true,
		
			pageParam:{
			url:api.pageParam.url,
			srcUrl:api.pageParam.srcUrl,
			title:api.pageParam.title,
           		needRecordHistory: true 
			}, 
    })
	

	
	
share();   //获取数据


  }







    function closeWin(){
      api.setScreenOrientation({
          orientation: 'portrait_up'
      });
      api.closeWin();
	  
	  
	  
		var browser = api.require('webBrowser');
		browser.closeView();
	  
    }














  function share(){
  

  
    api.ajax({
        url: api_url+'/login/login/share.html',
        method: 'get',
        data: {
            values: {
				key: 'qq166098756',   //安全码
                uid: localStorage.getItem('user_id')
            }
        }
    },function(ret, err){
        if (ret) {
		

	 		dwzapi = ret.dwzapi;  //短网址
			host = ret.host;  //当前域名
			app_Invitation_slogans = ret.app_Invitation_slogans;  //邀请标语
			

			//提现列表

            api.hideProgress();

        } else {
		
			api.hideProgress();
								
								
								
               api.toast({
                    msg: '信息获取失败',
                    duration: 2000,
					location : 'middle'   
                }); 

        }
    });


  }



 


    function sharetext() {
	
	
    api.ajax({
        url: 'http://suo.im/api.htm?format=json&url='+dwzapi+'&key=5d79adb9b1a9c71d20af521e@13c666f4f75d74d90b6c11dc3201ee67&expireDate=2050-01-01',
        method: 'get'
    },function(ret, err){
        if (ret) { 

value = app_Invitation_slogans+'：'+ret.url;

        } else {
value = app_Invitation_slogans+'：'+dwzapi;

        }
    });


        var sharedModule = api.require('shareAction');
        sharedModule.share({
            text: value,
            type: 'text'
        });
    };


</script>
</html>
